package org.su.mamamiya.core.ast;

import lombok.AllArgsConstructor;

import javax.annotation.processing.Messager;
import javax.lang.model.element.Element;
import javax.tools.Diagnostic;

/**
 * @auther yangchuan
 * @date 2020-03-08 11:10
 */
@AllArgsConstructor
public class Logger {

    private Messager messager;


    public void error(String msg){
        messager.printMessage(Diagnostic.Kind.ERROR, msg);
    }

    public void error(String msg, Element e){
        messager.printMessage(Diagnostic.Kind.ERROR, msg, e);
    }


    public void warn(String msg){
        messager.printMessage(Diagnostic.Kind.WARNING, msg);
    }

    public void warn(String msg,Element e){
        messager.printMessage(Diagnostic.Kind.WARNING, msg, e);
    }

    public void info(String msg){
        messager.printMessage(Diagnostic.Kind.NOTE, msg);
    }

    public void info(String msg,Element e){
        messager.printMessage(Diagnostic.Kind.NOTE, msg, e);
    }
}
